#define _CRT_SECURE_NO_WARNINGS 1

#include"heap.h"

void TEST1()
{
	heap hp;
	Heapinit(&hp);
	HeapPush(&hp, 1);
	HeapPush(&hp, 4);
	HeapPush(&hp, 3);
	HeapPush(&hp, 6);
	HeapPush(&hp, 8);
	HeapPush(&hp, 2);
	HeapPush(&hp, 5);
	HeapPop(&hp);
	printf("%d\n",HeapTop(&hp));
	PrintTopK((&hp)->a, (&hp)->size, (&hp)->size);
	printf("\n%d\n", HeapSize(&hp));
	printf("%d\n", HeapEmpty(&hp));
	HeapDestory(&hp);
}


void TEXT2()
{
	heap hp;
	int arr[] = { 2,4,5,3,7,8 };
	int len = sizeof(arr) / sizeof(arr[0]);
	HeapCreate(&hp, arr, len);
}

void TEXT3()
{
	int arr[] = { 5,6,4,7,3,8,11,233,9,55,68 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	HeapSort(arr, sz);
	PrintTopK(arr, sz, 5);
}

int main()
{
	TEXT3();
	return 0;
}